<?php
include "../conn.php";
include "s-cookie.php";
?>

<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>毕业设计-学生</title>
    <link rel="stylesheet" type="text/css" href="../css/htmleaf-demo.css">
    <link rel="stylesheet" type="text/css" href="../css/nav.css">
    <link rel="stylesheet" type="text/css" href="../fonts/iconfont.css">

    <link rel="stylesheet" href="../css/bootstrap-theme.css"/>

    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <link rel="stylesheet" href="../css/bootstrap-theme.min.css"/>
    <link rel="stylesheet" href="../css/bootstrap.css"/>
    <script type="text/javascript" src="../js/bootstrap3.0.3.min.js"></script>

    <link rel="stylesheet" type="text/css" href="../layer/theme/default/layer.css">
    <link rel="stylesheet" type="type/css" href="../layer/mobile/need/layer.css">
    <link rel="stylesheet" type="text/css" href="../css/style.css">


</head>
<body class="bodycolor">

<nav class="navbar navbar-default navbar-fixed-top" style="clear: left;">
    <div class="container">
        <div class="navbar-right navfont" id="navbar-collapse">
            <p>华软网络技术系毕业管理系统</p>
        </div>
    </div>
    <a href="s-cookie.php?cookie=out" id="out">退出</a>
</nav>


<div class="nav topx navbackground-s" id="nav">
    <div>

        <div style="border-bottom:1px solid rgba(255,255,255,.1)"><img src="../images/mini.png"></div>
    </div>
    <ul>
        <li class="nav-item">
            <a href="s-index.php"><i class="my-icon nav-icon icon_2"></i><span>首页</span><i class="my-icon nav-more"></i></a>

        </li>
        <li class="nav-item">
            <a href="s-mykt.php"><i class="my-icon nav-icon icon_1"></i><span>我的课题</span><i
                    class="my-icon nav-more"></i></a>
        </li>

        <li class="nav-item">
            <a href="s-examination.php"><i class="my-icon nav-icon icon_3"></i><span>成绩考核表</span><i
                    class="my-icon nav-more"></i></a>

        </li>
        <li class="nav-item">
            <a href="s-information.php"><i class="my-icon nav-icon icon_4"></i><span>我的资料</span><i
                    class="my-icon nav-more"></i></a>
        </li>
        <li class="nav-item">
            <a href="teachresearch.php"><i class="my-icon nav-icon icon_6"></i><span>选课</span><i
                    class="my-icon nav-more"></i></a>
        </li>
    </ul>
</div>

<div class="indexborder">

    <div>
        <div class="bannerdiv">
            <!--colspan="2"-->

            <div class="box-inline indexdiv1 panel panel-default auto" align="center">

                <div id="myCarousel" class="carousel slide">

                    <ol class="carousel-indicators">
                        <li data-target="#myCarousel" class="active"></li>
                        <li data-target="#myCarousel"></li>
                        <li data-target="#myCarousel"></li>
                    </ol>

                    <div class="carousel-inner">
                        <div class="item active">
                            <img src="../img/banner.jpg">
                        </div>
                        <div class="item">
                            <img src="../img/banner-1.jpg">
                        </div>
                        <div class="item">
                            <img src="../img/banner-2.jpg">
                        </div>
                    </div>

                    <a class="carousel-control left" href="#myCarousel" data-slide="prev">&nbsp;</a>

                    <a class="carousel-control right" href="#myCarousel" data-slide="next">&nbsp;</a>

                </div>

            </div>

        </div>

    </div>

    <div>

        <div>
            <div>
                <div class="panel-body box-inline panel panel-default paneldiv">
                    <p>
                        《礼记·大学》言及，大学之道在明明德，在亲民，在止于至善。莘莘学子正处于人生最宝贵时期，如初春，如朝日，如百卉之萌动，如利刃之新发于硎，当以独立之人格，自由之精神培育造就，使之成为人格健全、品德高尚，并掌握最新科技文化的时代弄潮儿。而华软学院美丽优雅的环境、充满人文关怀的氛围，囊括大典的学术讲坛、灵活多样的选课机制，均成为青年学子彰显美德、舒展个性、自由发展、达于至善的基石</p>
                </div>
            </div>

            <div id="news-s">

                <div id="newsTitle-s" style="background-color:#4c617f">华软新闻</div>

                <div id="newsBox-s">
                    <ul>
                        <?php



                        $sql = "select NewsId,NewName,Time from defensesummary where Year=" . $_SESSION["s-Year"];
                        $result = mysqli_query($conn, $sql);

                        while ($row = mysqli_fetch_array($result)) {
                            ?>
                            <li>
                                <a href="javascript:;"class="a-s" onclick="newcheck(<?= $row['NewsId'] ?>)"><?php echo $row['NewName'] ?></a>
                                <span><?php echo $row['Time'] ?></span>
                            </li>
                        <?php
                        }
                        ?>
                    </ul>
                </div>

                <div id="newsBot"></div>

            </div>
        </div>

    </div>

    <div class="tablediv">

        <div width="100%">
            <div>
                <!-- style="margin-left: 70px;"-->
                <div class="box-inline indexdiv2 panel panel-default auto" align="center">
                    <div class="panel panel-primary panel-success">
                        <div class="panel-heading" style="padding: 0px;color: black;font-style:initial;">
                            <h3 class="panel-title " style="background-color: #536d90;padding: 15px;">全部课题</h3>
                        </div>
                        <div class="panel-body">
                            <!--									<div class="table-responsive">-->
                            <table class="table  table-hover  table-striped">

                                <div id="fade" class="black_overlay-s">
                                    <!--//弹窗-->
                                </div>
                                <div id="MyDiv" class="white_content_small">
                                    <div style="text-align: right; cursor: default; height: 40px;">
                                        <span style="font-size: 1em;" onclick="CloseDiv('MyDiv','fade')">关闭</span>
                                    </div>
                                    <form>
                                        课题名称<input type="text"/><br> 学号

                                        <input type="text"/><br> 姓名

                                        <input type="text"/><br> 下载
                                        <a>任务书</a>
                                        <input type="file" name="upfile" size="15">
                                        <input type="submit" value="上传">
                                    </form>
                                </div>

                                <thead>
                                <tr class="thcolor-t">
                                    <th></th>
                                    <th>课题名</th>
                                    <th>类别</th>
                                    <th>来源</th>
                                    <th>指导教师</th>
                                    <th>学生</th>

                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php
                                $sql = "select p.ProjectName,p.Category,p.ProjectOrigin,t.TeacherName,s.StudentName,p.ProjectId
											from project as p join teacher as t on p.Teacher_TeacherId=t.TeacherId join student as s on
											p.Student_StudentId=s.StudentId where p.Year=" . $_SESSION["s-Year"];
                                $result = mysqli_query($conn, $sql);
                                while ($row = mysqli_fetch_array($result)) {
                                    ?>
                                    <tr>
                                        <td data-label=""></td>
                                        <td data-label="课题名"><?= $row[0] ?></td>
                                        <td data-label="类别"><?= $row[1] ?></td>
                                        <td data-label="来源"><?= $row[2] ?></td>
                                        <td data-label="指导教师"><?= $row[3] ?></td>
                                        <td data-label="学生"><?= $row[4] ?></td>
                                        <td data-label="操作"><input type="button" value="查看" onclick="check(<?=$row[5]?>)"></td>
                                    </tr>
                                <?php
                                }
                                ?>
                                </tbody>
                            </table>

                        </div>
                        <!--								</div>-->
                    </div>
                </div>
            </div>
        </div>

    </div>

</div>

<!--<footer class="indexfooter container-fluid  bottom">-->
<!--    <p class="footer-p" align="center">地址：广东省广州市从化区经济开发区高技术产业园广从南路548号 | 电话：020－87818918 邮编：510990 |-->
<!--        网站公安备案编号：4401840100050 粤ICP备：05085382号 站长统计</p>-->
<!--</footer>-->

<script type="text/javascript">
    var area = document.getElementById("newsBox-s");
    area.innerHTML += area.innerHTML;

    var iheight = 24;
    area.scrollTop = 0;
    var time;

    function starMove() {
        area.scrollTop++;
        time = setInterval("goUp()", 50);
    }

    function goUp() {
        if (area.scrollTop % iheight == 0) {
            clearInterval(time);
            setTimeout("starMove()", 2000);
        } else {
            area.scrollTop++;
            if (area.scrollTop >= area.scrollHeight / 2) {
                area.scrollTop = 0;
            }
        }

    }

    setTimeout("starMove()", 2000);
</script>

<script>
    window.jQuery || document.write('<script src="js/jquery-1.11.0.min.js"><\/script>')
</script>
<script type="text/javascript">  //弹窗实现
    function newcheck(id) {
        var path = "../detailednews.php?newId=" + id;
        layer.open({
            type: 1,
            area: ['80%', '80%'],
            shadeClose: true, //点击遮罩关闭
            content: "<iframe src='detailednews.php'  width='98%' height='94%' name=main frameborder= scrolling=NO id='testFrame'></iframe>"
        });
        var t = document.getElementById("testFrame");
        t.src = path;
    }
    function check(id) {
        var path = "../taskinfo.php?projectId=" + id;
        alert(path);

        layer.open({
            type: 1,
            area: ['80%', '80%'],
            shadeClose: true, //点击遮罩关闭
            content: "<iframe src=''  width='98%' height='94%' name=main frameborder= scrolling=NO id='testFrame'></iframe>"
        });
        var t = document.getElementById("testFrame");
        t.src = path;
    }
</script>
<script type="text/javascript" src="../js/nav.js"></script>
<script type="text/javascript" src="../layer/layer.js"></script>
</body>

</html>
